<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var re=new RegExp('a','i');//js写法  'i'表示忽略大小写
        var re=/a/i;//prol写法
        var str='Abcdef';
        alert(str.search(re));
    </script>
</head>
<body>

</body>
</html>